<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;  charset=utf-8" />
<title>Login Page</title>
<script type="text/javascript" >
function button_signup()
{       
    if(document.signupForm.firstname.value == "" )
            alert("Enter First Name!"); 

    else if(document.signupForm.lastname.value == "")
            alert("Enter Last Name!");
    
    else if(document.signupForm.femail.value == "")
            alert("Enter Email!");
        
    else if(document.signupForm.reemail.value == "")
            alert("Re-Enter Email!");
            
    else if(document.signupForm.newpassword.value == "")
            alert("Enter New Password!");
        
    else if(document.signupForm.gender.value == "g")
            alert("Select Gender!");
    
    else if(document.signupForm.femail.value != document.signupForm.reemail.value)
            alert("Emails must match!");
    
    else
            document.signupForm.submit(); 
}

function button_login()
{
	if(document.loginForm.username.value==""||
	   document.loginForm.password.value=="")
	{
		alert("empty fields!");
	}
	
	else
	{
		document.loginForm.submit();
	}
}

</script>
</head>
<body>
<table width="800" border="1">
  <tr>
    <td><img src="Logo.jpg" width="800" height="150" /></td>
  </tr>
  <tr>
    <td>
    <form name="loginForm" action="login.jsp" method="post" >
    <label>Email: </label>
    	<input name="username" type="text" id="username"/>      
   	  <label> &nbsp;&nbsp;&nbsp;&nbsp;Password: </label>
        <input name="password" type="password" size="40" id="password" />  
       &nbsp;&nbsp;&nbsp;&nbsp; <input type="button" id="loginbutton" value="  Log in  " onclick="return button_login()" />
    </form></td>
  </tr>
  <tr>
  	<td align="center" valign="top">
    	<label><font size="6"><strong><br />
   	    Please log in to start using The Loop!<br />
    	</strong></font></label>
    </td>
  </tr>
  <tr>
      <td align="right" style="padding-right: 50px;" >
      <label><strong>Sign up now!</strong><br /></label>

        <form  name="signupForm" id="signupForm" action="signup.jsp" method="post" >
          <label>First Name: </label>
          <input name="firstname" type="text" size="40"/><br /><br />
          
          <label>Last Name: </label>
          <input name="lastname" type="text" size="40"/><br /><br />
         
          <label>Your Email: </label>
          <input name="femail" type="text" size="40"/><br /><br />
          
          <label>Re-enter Email: </label>
          <input name="reemail" type="text" size="40"/><br /><br />
         
          <label>New Password: </label>
          <input name="newpassword" type="password" size="40"/><br /><br />
         
          <label>I am: </label>
          <select name="gender">
            <option value="g">Select Gender: </option>
            <option value="M">Male</option>
            <option value="F">Female</option> 
          </select><br /><br />
                  
            <input type="button" id="signup" onclick="return button_signup()" value="Sign me up!" />
        </form>
    </td>
  </tr>
</table>
</body>
</html>
